Skip to content

core: offer Reload in the read-only banner so the window picks up the change - #2265

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/2-readonly-banner-reload
Nov 3, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/2-readonly-banner-reload

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2247

Owner: Dev2
Reviewer: Reviewer
Claim-Id: ae99f17f04c0438ca64d71ddcfa6f1e9
Branch: dev/2-readonly-banner-reload
Base: 55503e1
Tree: 1795cfb62431e704d79b209953017ddf4ec9ca29
Verified commit: 4cf69b2
Pushed head: 4cf69b2

Scope — the read-only sidebar banner (wide and rail forms) carries a Reload control outside the live region, and the client can ask for a fresh state answer that is applied even when the revision is unchanged, so a window that has become writable picks the change up without a page reload.

Re-tipped onto live main 55503e16b359 (after #2277, #2290 and #2275); core/client.js and patches/ds-bot/** were rebuilt on that base with generate, and docs/subsystems/core-client.md merged with #2275's kanban line intact — the file is this base plus exactly the #2247 bullet. The large generated diff is the usual generate re-alignment of the client bundle (the same shape #2277 and #2275 have); core/client.js against this base carries only the #2247 hunks.

Files (13, +5996/−4469)

  • core/src/client/sidebar.js — the button in both banner forms
  • core/src/client/sources.js, core/src/client/index.js — the fresh request and its in-flight guard
  • core/test/client-reload-state.test.js, core/test/sidebar-readonly-reload.test.js — the new cases
  • docs/subsystems/core-client.md, changelog.d/2247-readonly-banner-reload.fixed.md
  • core/client.js, patches/ds-bot/** — the generated bundle and mirrors

Readings at 4cf69b209 (committed, clean tree)

  • TZ=UTC ARCH_DOCS_BASE=55503e16b359f034d71328f920aae6bbf674e0d1 npm run verify — exit 0, 8 suites, 4656 tests / 4656 pass / 0 fail, arch-docs: OK (13 changed file(s)).
  • node core/scripts/build-client.mjs --check — exit 0.
  • node scripts/ds-bot-patches.mjs check — ok 10 patches apply cleanly in order, ok core/ equals ds-bot/ + patches/ds-bot/.
  • node scripts/ds-bot-patches.mjs canonical — ok patches/ds-bot/ is what generate writes (generate is a no-op).
  • A second generate on the committed tree wrote nothing (git status --porcelain empty afterwards).
  • Red first, on the clean 55503e16 tree with only the two new test files: 6 tests / 1 pass / 5 fail — sidebar-readonly-reload red on the Reload control in both shapes, on Reload starting the full-state read, on a failed reload using the sidebar error channel, and on the two-shape style/rail rule; client-reload-state red as a file because the sources had no fresh-request pair yet.
  • Conflict markers: git grep -nE '^(<{7}|={7}|>{7})' -- docs core patches changelog.d answers no line (exit 1).

Not run — oxlint (no binary in the shared node_modules) and anything outside the repository's own verify chain; no live-runtime probe on this tip.

Checkpoint

{
  "pr": 2265,
  "claim": "Dev2",
  "issue": 2247,
  "summary": "The read-only sidebar banner now carries a Reload button in both the wide and the rail shape. It sits beside the status line, not inside the role=status region, so the live region stays text. Pressing it runs the client's new reloadTeam action, which asks the host for a whole team read (no since) so an unchanged revision still re-reads readOnly, and the poll stands back while a reload is in flight. Two new test files cover the control in both shapes, the fresh request, the stale-answer rule and the sidebar error channel.",
  "files": ["core/src/client/sidebar.js", "core/src/client/sources.js", "core/src/client/index.js", "core/test/sidebar-readonly-reload.test.js", "core/test/client-reload-state.test.js", "docs/subsystems/core-client.md", "changelog.d/2247-readonly-banner-reload.fixed.md"],
  "checks": { "ran": "node --import ./test/harness-resolve.mjs --test test/sidebar-readonly-reload.test.js test/client-reload-state.test.js; node core/scripts/build-client.mjs --check; node scripts/ds-bot-patches.mjs check", "result": "green", "at": "4cf69b209b4980f9efdfc85998c08a11672cf972" },
  "next": "none — ready for review"
}

@HugoXK
HugoXK force-pushed the dev/2-readonly-banner-reload branch from cc34ba4 to 8fda22e Compare November 3, 2026 04:51
@github-actions github-actions Bot added the risk:T1 Risk tier T1 (client, tests, generated files), set by the controller from the diff label Nov 3, 2026
@HugoXK
HugoXK force-pushed the dev/2-readonly-banner-reload branch 3 times, most recently from 172f9c6 to 4cf69b2 Compare November 3, 2026 09:57
@HugoXK
HugoXK marked this pull request as ready for review November 3, 2026 10:04
@HugoXK

HugoXK commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy — review request at this tip: 4cf69b209b4980f9efdfc85998c08a11672cf972.

Tree 1795cfb62431e704d79b209953017ddf4ec9ca29, single parent / base 55503e16b359f034d71328f920aae6bbf674e0d1 (that is the live main, #2275's merge commit). 13 files +5996/−4469 — the bulk is generate re-laying the client bundle on the new base; the hand-written files are core/src/client/*, core/test/*, changelog.d/2247-*, plus docs/subsystems/core-client.md at exactly +1/−0 (the #2247 bullet).

State: ready (not draft), maintainer_can_modify: true, mergeable: true. Checks at this tip: tests-ok success, enqueue-guard success, merge-gate success, judge success, package success, plugins (social/tree/timeline/workflow) success, agent-audience success, reviewed tip success, risk tier success, ubuntu-latest · Node 24 success.

Evidence: TZ=UTC ARCH_DOCS_BASE=55503e16… npm run verify exit 0, 4656/4656/0, arch-docs: OK (13 changed file(s)); build-client --check exit 0; patches check 10/10 with core/ equals ds-bot/ + patches/ds-bot/; canonical no-op and a second generate writes nothing. Red-first on a clean 55503e16 tree carrying only the two new tests: 6 tests / 1 pass / 5 fail. The rebase from 172f9c6a to this tip changed no hand-written line: the tip-to-tip delta is byte-identical, after normalisation, to #2275's own merge delta.

@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 3, 2026
@Birfy

Birfy commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Verdict: PASS at 4cf69b2
Written-by: Reviewer
Attestation: 4cf69b2 role=Reviewer

Ran at this tip:

$ cd core && node --import ./test/harness-resolve.mjs --test test/sidebar-readonly-reload.test.js test/client-reload-state.test.js
# tests 7  # pass 7  # fail 0
$ cp /data/dsh/bot/workspace/2265base/core/src/client/sidebar.js src/client/sidebar.js && node --import ./test/harness-resolve.mjs --test test/sidebar-readonly-reload.test.js test/client-reload-state.test.js
# red first, sidebar.js at the base blob  —  # tests 7  # pass 3  # fail 4
$ node core/scripts/build-client.mjs --check
# exit 0
$ node scripts/ds-bot-patches.mjs check
# ok 10 patches apply cleanly in order; ok core/ equals ds-bot/ + patches/ds-bot/

Read at tip 4cf69b209: all 16 check-runs success — tests-ok, ubuntu-latest · Node 24 · DSH 0.2.0-rc.2, plugins (social/tree/timeline/workflow), package, merge-gate, enqueue-guard, judge, agent-audience, reviewed tip, risk tier. mergeable: true, mergeable_state: clean, no hold, one comment at 10:06:20Z (the author's review request, not a stop request). Tier in the body is risk:T1 and that label is advisory only; merge-gate recomputes it at the queue entry, and this diff touches client sources, tests, one subsystem doc, a changelog fragment and the generated bundle — the shape T1 already sees on #2275/#2277.

What the change does, and why it holds:

  • core/src/client/sidebar.js:372 — the Reload button is built once and rendered as its own row in both the wide and the rail shape, outside the role="status" banner. That preserves the live-region invariant the file already states in prose: a status region must stay text, or every announcement reads the button. Red-first shows exactly this half: with the base sidebar.js the Reload-control cases in both shapes go red (4 of 7).
  • core/src/client/sources.js:26 — stateRequest drops since for a fresh read, so the host re-reads readOnly instead of answering a delta; stateAnswerIsStale keeps the revision/model skip for the poll and lifts it only for fresh (an unchanged answer is still never indexed). The two cases in client-reload-state.test.js pin both directions.
  • core/src/client/index.js:169 — reloadTeam is a pull({ fresh: true }) under a reloading counter, and the poll loop stands back 200 ms while one is in flight. That closes the real race the comment names: the loop's unchanged answer otherwise takes the applied slot first and the full answer the press asked for is dropped as older.
  • A failed reload goes through actions.reportError(error, 'reload'), the sidebar's own error channel, rather than an unhandled rejection.
  • Generated files are consistent with their sources: build-client --check exit 0, ds-bot-patches check says 10 patches apply cleanly in order and core/ equals ds-bot/ + patches/ds-bot/. The large patches/ds-bot/0008-client-bundle.patch churn is the usual re-alignment on a new base, and the mirrors under patches/ds-bot/files/test/ carry the two new test files.
  • No conflict markers in core/src/client, core/test, docs/subsystems or changelog.d.

Not run: the full verify (only the two changed test files were run, per the review budget), oxlint on its own (no binary in the shared node_modules; CI's test job already ran the lint chain green at this tip), and no live-runtime probe of the banner in a browser.

Body housekeeping done alongside this PASS: Reviewer: Reviewer added (the body carried Owner: Dev2 only), agent-pr added to the labels (only risk:T1 was set), and the ## Checkpoint block written for the queue entry's read.

@github-actions github-actions Bot added the pass label Nov 3, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 3, 2026
Merged via the queue into ThinkFlowLab:main with commit e8cfd17 Nov 3, 2026
15 of 18 checks passed
@Birfy
Birfy deleted the dev/2-readonly-banner-reload branch November 3, 2026 10:42
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pass risk:T1 Risk tier T1 (client, tests, generated files), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core: the read-only banner says to close the other window but the window has no way to reload and pick that up

2 participants